Navmesh Rules
Navmesh Rules Okay, lets talk about the rules involved in a navmesh. If any one of these rules are broken, your navmesh will not work in the game and will cause a crash to desktop on load. 1.) Must be one island This means just what it says. Because the navmesh is simply a 3d copy of the terrain in which it covers, it is easy to visualize it as an 'island.' There can not be two or more separate pieces of navmesh, or 'islands', in the level. I'll go into this in more depth as we work through the Mashtuur obj files in Maya. An example of the main island, with a floating isolated island and an illegal 'manifold' polygon attached by only one vertice. These are very easily fixed in Maya. A poly or 'face' must always have one side connected to the mesh, never just one corner. 2.) Every Polygon must be a triangle. By default, the navmesh generation process will never produce a poly that isn't a triangle, but it is worth noting that if you are creating extra mesh by hand, it must always be subdivided back to triangles. This will also be covered in depth later. 3.) No Manifold Poly's. In layman's terms this is when a poly is attached by only one vertice to the main mesh like in the example picture to the right. 4.) No Floating vertices. Also pretty rare in my experience and only really turn up if you follow the wrong processes when deleting and/or editing parts of your mesh. A vertice is just one of the little purple dots at the corner of each triangle in the picture. Just make sure there are none of these floating in space. 5.) Must be non-self-intersecting. In laymen's terms - the mesh must never pierce itself. When dragging vertices around for an hour its quite easy for this to happen. As shown in the picture a vertice has accidentally been placed up through another face. So this is now classed as self intersecting. BF2 does not take kindly to this sort of barbaric, face piercing behavior! 6.) No Double Edges, Vertices or Faces. No double edges. See in the example how more than 2 faces share an edge. This is not allowed. Also, Double vertices are not allowed. A vertice must never be in the middle of an edge, it must always be a corner of a triangle. 7.) No Opposite Facing Normals Another rare one but worth mentioning. This is when two faces are connected to each other but actually face in opposite directions. Also bad, and only really happens when you're up till 4am every night, eyes half closed and you are welding vertices together haphazardly with an almost drained rechargeable mouse, while in the midst of a micro-nap. That about sums up what NOT to do to navmesh geometry. Most of these are caused by the mistakes of the user. The only ones that the navmesh generator usually gets wrong are floating islands (isolated poly's.) So with all that in mind, we're now going to jump in Maya and fix our first navmesh.